package com.bjpowernode.rbac.mapper;

import com.bjpowernode.rbac.entity.Role;
import com.bjpowernode.rbac.query.QueryObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    List<Role> selectAll();

    List<Role> selectByCondition(QueryObject queryObject);

    void deleteRelation(Long id);

    void addRelation(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    void deleteAllRelation();
}